textbuffer: Try harder to fix pasting
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 Dec 2021 02:42:19 +0000 (21:42 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 1 Dec 2021 02:42:19 +0000 (21:42 -0500)
commit3e7618fef7858fe90dfffee9db951d30009dedf8
treef87da9a10713ca80b6b14b184948d987c01acb7e
parent5b1b75b055d0e40ee5c399aec2fb15ade7ef535b
textbuffer: Try harder to fix pasting

It turns out we can't just use the size returned
by the memory stream as-is, since it may contain
unfilled garbage at the end, which utf8 validation
will choke on. So, cut it off at the first '\0'
we find.
gtk/gtktextbuffer.c